<template>
  <div class="goods">
    <h3>商品名称:{{ pname }}</h3>
    <p>商品单价:{{ price }}</p>
    <p>商品介绍:{{ info }}</p>
    <button @click="$emit('kanyidao', id)">砍一刀</button>
  </div>
</template>

<script>
export default {
  props: {
    id: {
      required: true,
      type: Number,
    },
    pname: {
      default: "方便面",
    },
    price: Number,
    info: {
      default: "有点甜",
    },
  },
};
</script>

<style lang=less>
.goods {
  padding: 10px;
  margin: 8px;
  border: 3px solid #000;
  min-height: 50px;
  width: 300px;
}
</style>